<?php
/**
 * Created by PhpStorm.
 * User: 13790
 * Date: 2018/3/22
 * Time: 15:49
 */

namespace app\common\validate;


use think\Validate;

class Auth extends Validate
{
    protected $rule=[
        'auth_name'     =>  'require|length:2,16',
        'auth_m'        => 'require',
        'auth_c'        =>  'require',
        'auth_f'        =>  'require',
        'auth_order'    =>  'require|number',
        'pid'      =>  'require'
    ];
    protected $message = [
        'auth_name.require' =>  '权限名称不能为空',
        'auth_name.length'  =>  '权限名称长度不符合',
        'auth_m.require'    =>  '模块名不能为空',
        'auth_c.require'    =>  '控制器不能为空',
        'auth_f.require'    =>  '方法名不能为空',
        'pid.require'       =>  '上级不能为空',
        'pid_number'        =>  '上级访问有误',
        'auth_order.require'        =>   '排序不能为空',
    ];

    protected $scene = [
        'add'   =>  'auth_name,auth_c,auth_m,auth_f,auth_order,pid',
        'edit'   =>  'auth_name,auth_c,auth_m,auth_f,auth_order,pid'
    ];

}